<template>
  <view class="information">
    <view class="optionList">
      <view class="optionItem">
        <text class="optionTitle">收款码id</text>
        <input type="text" placeholder="请输入收款码id" v-model="code" />
      </view>
    </view>
    <view class="footer">
      <u-button
        @click="submit"
        :custom-style="{ width: '600rpx', height: '80rpx' }"
        type="error"
        shape="circle"
        >立即绑定</u-button
      >
    </view>
  </view>
</template>

<script>
import myPicker from "./myPicker.vue";
export default {
  components: {
    myPicker,
  },
  props: {
    bind_store_id: {
      type: [String, Number],
      default: "",
    },
    status: {
      type: [String, Number],
      default: "",
    },
    type:{
      type:String,
      default: "weixin",
    },
	qrcode_id: {
      type: null,
      default: "",
    },
    mini_id: {
      type: [String, Number],
      default: "",
    },
  },
  data() {
    return {
      code: "",
    };
  },
  created() {
    this.code = this.qrcode_id;
  },
  computed: {},
  methods: {
    // 点击提交审核
    async submit() {
      if (!this.code) {
        uni.showToast({
          title: "请输入收款码id",
          icon: "none",
        });
        return;
      }
			uni.showLoading({
				title: this.$t("home.loading"),
			});
      let param = { mini_id: this.mini_id, qrcode_id: this.code, bind_store_id: this.bind_store_id};
      const res = await this.$allrequest.newStore.set_qrcode_rules(param, true);
			uni.hideLoading();
			uni.showToast({
				title: res.msg,
				icon: "none",
				duration: 1500,
			});
      if (res.code == 0) {
        this.$utils.showModal("提示", "提交成功！", false, () => {
          uni.navigateBack({
            delta: 1,
          });
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.information {
  .optionList {
    padding-left: 24rpx;
    background-color: #fff;
    .optionItem {
      padding-top: 30rpx;
      padding-bottom: 30rpx;
      border-bottom: 1px solid #f8f8f8;
      display: flex;
      flex-direction: column;
      font-size: 24rpx;
      padding-right: 30rpx;
      .optionTitle {
        margin-bottom: 24rpx;
      }
      .optionChoose {
        display: flex;
        align-items: center;
        justify-content: space-between;
        .iconfont {
          font-size: 24rpx;
          color: #888;
        }
      }
      .chooseType {
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #8c8c8c;
        font-size: 24rpx;
        .iconfont {
          font-size: 24rpx;
          color: #888;
        }
      }
      input {
        width: 100%;
      }
      .tip {
        font-size: 24rpx;
        color: #8c8c8c;
        margin-top: 24rpx;
        display: flex;
        flex-direction: column;
      }
      .sceneList {
        display: flex;
        flex-wrap: wrap;
        text {
          height: 60rpx;
          line-height: 60rpx;
          padding: 0 24rpx;
          background-color: #f2f2f2;
          border-radius: 30rpx;
          font-size: 24rpx;
          color: #8c8c8c;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
          font-weight: 600;
        }
        .current {
          border: 1px solid #f60313;
          background-color: #fbeceb;
          color: #f0250e;
        }
      }
      .addPic {
        width: 160rpx;
        height: 160rpx;
        border-radius: 10rpx;
        background-color: #f6f6f6;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        font-size: 24rpx;
        color: #8c8c8c;
        .iconfont {
          font-size: 56rpx;
          margin-bottom: 12rpx;
        }
        image {
          width: 100%;
          height: 100%;
        }
      }
    }
    .optionItem:last-child {
      border-bottom: none;
    }
  }
  .footer {
    display: flex;
    padding-top: 10rpx;
    justify-content: center;
    border-top: 1px solid #f8f8f8;
    padding-bottom: 10rpx;
    padding-bottom: calc(constant(safe-area-inset-bottom) + 10rpx);
    padding-bottom: calc(env(safe-area-inset-bottom) + 10rpx);
    .btn {
      width: 80%;
      height: 80rpx;
      border-radius: 999px;
      background-color: #f0250e;
      color: #fff;
      font-size: 32rpx;
      font-weight: 600;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
</style>